package com.hulk.ratel.common.constant;

import java.util.HashMap;
import java.util.Map;


/**
 * 公用常量类
 * 
 * @author hulk
 */
public class CommonConstant {
	
	

	/**
	 * 产品受众
	 * @author hulk
	 *
	 */
	public enum ProductTargetAudience {
		ProductTargetAudience_TERRACE("TERRACE", "平台"),
		ProductTargetAudience_SOGO("SOGO", "商户"),
		ProductTargetAudience_03("", "");
		String value;
		String desc;

		ProductTargetAudience(String value, String desc) {
			this.value = value;
			this.desc = desc;
		}

		public String getValue() {
			return this.value;
		}

		public String getDesc() {
			return this.desc;
		}

		public static String explain(String value) {
			if (ProductTargetAudience_TERRACE.getValue().equals(value)) {
				return ProductTargetAudience_TERRACE.desc;
			} else if(ProductTargetAudience_SOGO.getValue().equals(value)){
				return ProductTargetAudience_SOGO.desc;
			}else {
				return ProductTargetAudience_03.desc;
			}
		}
		public static Map<String, Map<String, Object>> toMap() {
			ProductTargetAudience[] ary = ProductTargetAudience.values();
			Map<String, Map<String, Object>> enumMap = new HashMap<String, Map<String, Object>>();
			for (int num = 0; num < ary.length; num++) {
				if (!"".equals(ary[num].value)) {
					Map<String, Object> map = new HashMap<String, Object>();
					String key = ary[num].value;
					map.put("desc", ary[num].getDesc());
					enumMap.put(key, map);
				}
			}
			return enumMap;
			
		}

	}




	/**
	 * 复核标志
	 * @author hulk
	 *
	 */
	public enum ReauditedFlag{
		ReauditedFlag_N("N", "未复核"),
		ReauditedFlag_Y("Y", "已复核");

		String value;
		String desc;

		ReauditedFlag(String value, String desc) {
			this.value = value;
			this.desc = desc;
		}

		public String getValue() {
			return this.value;
		}

		public String getDesc() {
			return this.desc;
		}

		public static String explain(String value) {
			if (ReauditedFlag_N.getValue().equals(value)) {
				return ReauditedFlag_N.desc;
			} else {
				return ReauditedFlag_Y.desc;
			}
		}
		public static Map<String, Map<String, Object>> toMap() {
			ReauditedFlag[] ary = ReauditedFlag.values();
			Map<String, Map<String, Object>> enumMap = new HashMap<String, Map<String, Object>>();
			for (int num = 0; num < ary.length; num++) {
				if (!"".equals(ary[num].value)) {
					Map<String, Object> map = new HashMap<String, Object>();
					String key = ary[num].value;
					map.put("desc", ary[num].getDesc());
					enumMap.put(key, map);
				}
			}
			return enumMap;
			
		}

	}

}
